package com.zhaoyu.utils.threadlocal;

import com.zhaoyu.model.admin.pojos.AdUser;

/**
 * 使用过滤器解析后的用户需要放在当前线程中
 */
public class AdminThreadLocalUtils2 {

    private final static ThreadLocal<AdUser> userThreadLocal = new ThreadLocal<>();

    /**
     * 设置当前线程中的用户(AdUser)
     */
    public static void setUser(AdUser adUser){
        userThreadLocal.set(adUser);
    }

    /**
     * 获取线程中的用户(AdUser)
     */
    public static AdUser getUser( ){
        return userThreadLocal.get();
    }

}